{% extends 'base.html' %}

{% block content %}
<div class="container" style="margin-top: 200px">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header bg-primary text-white">注册</div>
                <div class="card-body">
                    <form method="POST">
                        {% csrf_token %}
                        <div class="form-group">
                            <label for="{{ form.username.id_for_label }}">用户名:</label>
                            {{ form.username }}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.email.id_for_label }}">邮箱:</label>
                            {{ form.email }}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.password1.id_for_label }}">密码:</label>
                            {{ form.password1 }}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.password2.id_for_label }}">确认密码:</label>
                            {{ form.password2 }}
                        </div>
                        <button type="submit" class="btn btn-primary">注册</button>
                    </form>
                </div>
            </div>
            <div class="text-center mt-3">
                <small>已有帐号？<a href="{% url 'login' %}">登录</a></small>
            </div>
        </div>
    </div>
</div>
{% endblock %}
